<h2><?php echo $this->translate( 'club_carnauba' ); ?></h2>

<?php if( $this->sendInfo ) { ?>
<div class="content">
<?php echo $this->translate( 'club_sendinfo' ) ?>
</div>
<?php } else { ?>
<div class="content">

	<div class="contentcolumn">
		<?php echo $this->text['lead_' . $this->locale]; ?>
	<div class="clr"></div>
	</div>
	
</div>

<h2 class="mtop5"><?php echo $this->translate( 'club_join' ); ?></h2>

<?php echo $this->inlineScript()->setScript('
$(document).ready(function(){
	$.validator.addMethod("nameRegex", 
		function(value, element) {
        	return this.optional(element) || /^[^0-9]+$/i.test(value);
    }, 
    "Możesz używać tylko liter.");
    
	$.validator.addMethod("zipRegex", 
		function(value, element) {
        	return this.optional(element) || /^\d{2}-\d{3}$/i.test(value);
    }, 
    "Zly kod pocztowy.");
    
	$.validator.addMethod("telRegex", 
		function(value, element) {
        	return this.optional(element) || /^[0-9\-\ \(\)\+]+$/i.test(value);
    }, 
    "' . $this->translate( 'club_error_phone' ) . '");
    
	$("#club-form").validate({
		rules: {
			name : {
				required: true,
				minlength: 2,
				nameRegex: true
			},
			surname : {
				required: true,
				minlength: 2,
				nameRegex: true
			},
			email : {
				required: true,
				email: true
			},
			phone : {
				required: true,
				minlength: 7,
				telRegex: true
			},
			birthday_day : {
				required: true,
				minlength: 1,
				number:true,
				maxlength: 2
			},
			birthday_month : {
				required: true,
				minlength: 2,
				number:true,
				maxlength: 2
			},
			birthday_year : {
				required: true,
				minlength: 4,
				number:true,
				maxlength: 4
			},
			locality : {
				required: true,
				minlength: 2,
				nameRegex: true
			},
			street : {
				required: true,
				minlength: 2,
				nameRegex: true
			},
			nr_home : {
				required: true,
				minlength: 2,
				number: true
			},
			zip : {
				required: true,
				minlength: 2,
				zipRegex: true
			},
			rules : {
				required: true
			},
			rules2 : {
				required: true
			}
		},
		messages: {
			name : "' . $this->translate( 'club_error_name' ) . '",
			surname : "' . $this->translate( 'club_error_surname' ) . '",
			email : "' . $this->translate( 'club_error_email' ) . '",
			phone : "' . $this->translate( 'club_error_phone' ) . '",
			locality : "' . $this->translate( 'club_error_locality' ) . '",
			birthday_day : "' . $this->translate( 'club_error_birthday_day' ) . '",
			birthday_month : "' . $this->translate( 'club_error_birthday_month' ) . '",
			birthday_year : "' . $this->translate( 'club_error_birthday_year' ) . '",
			street : "' . $this->translate( 'club_error_street' ) . '",
			nr_home : "' . $this->translate( 'club_error_nr_home' ) . '",
			zip : "' . $this->translate( 'club_error_zip' ) . '",
			rules : "' . $this->translate( 'club_error_rules' ) . '",
			rules2 : "' . $this->translate( 'club_error_rules2' ) . '"
		}
	});
});
'); ?>

<div class="content">
<form id="club-form" method="post">
	<table class="mcenter">
	<tr>
		<td class="width205">
		<?php echo $this->translate( 'name' ) ?>
		</td>
		<td>
		<input type="text" id="cname" name="name" value="" class="style1 width410">
		</td>
	</tr>
	<tr>
		<td class="width205">
		<?php echo $this->translate( 'surname' ) ?>
		</td>
		<td>
		<input type="text" id="csurname" name="surname" value="" class="style1 width410">
		</td>
	</tr>
	<tr>
		<td class="width205">
		<?php echo $this->translate( 'email' ) ?>
		</td>
		<td>
		<input type="text" id="cemail" name="email" value="" class="style1 width410">
		</td>
	</tr>
	<tr>
		<td class="width205">
		<?php echo $this->translate( 'phone' ) ?>
		</td>
		<td>
		<input type="text" id="cphone" name="phone" value="" class="style1 width410">
		</td>
	</tr>
	<tr>
		<td class="width205">
		<?php echo $this->translate( 'birthday' ) ?>
		</td>
		<td>
		<input type="text" id="cbirthday_day" name="birthday_day" value="" class="style1 width20">
		<input type="text" id="cbirthday_month" name="birthday_month" value="" class="style1 width20">
		<input type="text" id="cbirthday_year" name="birthday_year" value="" class="style1 width40">
		</td>
	</tr>
	<tr>
		<td class="width205">
		<?php echo $this->translate( 'locality' ) ?>
		</td>
		<td>
		<input type="text" id="clocality" name="locality" value="" class="style1 width410">
		</td>
	</tr>
	<tr>
		<td class="width205">
		<?php echo $this->translate( 'street' ) ?>
		</td>
		<td>
		<input type="text" id="cstreet" name="street" value="" class="style1 width410">
		</td>
	</tr>
	<tr>
		<td class="width205">
		<?php echo $this->translate( 'nr_home' ) ?>
		</td>
		<td>
		<input type="text" id="cnr_home" name="nr_home" value="<?php echo $this->nr_home ?>" class="style1 width250">
		</td>
	</tr>
	<tr>
		<td class="width205">
		<?php echo $this->translate( 'zip' ) ?>
		</td>
		<td>
		<input type="text" id="czip" name="zip" value="<?php echo $this->zip ?>" class="style1 width250">
		</td>
	</tr>
	<tr>
		<td class="aright paddingr12">
		<div class="checkbox mtop15"><input id="crules" type="checkbox" name="rules" value=""><label for="crules"></label></div>
		</td>
		<td class="paddingt12">
		<?php echo $this->translate( 'rules' ) ?> <a target="_blank" class="cyellow" href="<?php echo $this->baseUrl() ?>/index/static/p/rules">regulaminu</a>
		</td>
	</tr>
	<tr>
		<td class="aright paddingr12">
		<div class="checkbox mtop15"><input type="checkbox" id="crules2" name="rules2" value=""><label for="crules2"></label></div>
		</td>
		<td class="paddingt12">
		<?php echo $this->translate( 'rules2' ) ?>
		</td>
	</tr>
	<tr>
		<td colspan="2" class="aright">
		<input type="submit" name="" value="<?php echo $this->translate( 'send' ) ?>" class="button2">
		</td>
	</tr>
	</table>
</form>
</div>
<?php } ?>